﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;

public partial class ChucNang_Admin_Admin_ThongKeDoanhThuSanPhamTheoThang : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void btnThongKe_Click(object sender, EventArgs e)
    {
        DataDSTableAdapters.DATHANGTableAdapter adapter = new DataDSTableAdapters.DATHANGTableAdapter();
        DataDSTableAdapters.TAIKHOANTableAdapter tkadapter = new DataDSTableAdapters.TAIKHOANTableAdapter();
        DataDS.TAIKHOANDataTable tktable = new DataDS.TAIKHOANDataTable();
        int id_tk=int.Parse(dropdownlistKhachHang.SelectedValue.ToString());
        
        tktable=tkadapter.TAIKHOAN_LayTheoId(id_tk);
        imgKhachHang.ImageUrl=tktable.Rows[0]["Avatar"].ToString();
        imgKhachHang.DataBind();
        
        lbCMND.Text = tktable.Rows[0]["CMND"].ToString();
        lbCMND.DataBind();
        if (dropdownlistKhachHang.SelectedValue != null )
        {
            Label1.Visible = true;
            lbCMND.Visible = true;
            Label2.Visible = true;
            btnXem.Visible = true;
            dropdownNam.Visible = true;
            GridView1.DataSource = adapter.DATHANG_ThongKeMuaHangKhachHangTheoNam(id_tk);
            GridView1.DataBind();
        }
       

    }
    protected void btnXem_Click(object sender, EventArgs e)
    {
        int nam = int.Parse(dropdownNam.SelectedValue.ToString());
        int id_tk = int.Parse(dropdownlistKhachHang.SelectedValue.ToString());
        DataDSTableAdapters.DATHANG_CHITIETDATHANG_SANPHAMTableAdapter adapter = new DataDSTableAdapters.DATHANG_CHITIETDATHANG_SANPHAMTableAdapter();
        GridView2.DataSource = adapter.DATHANG_CHITIETDATHANG_SANPHAM_ThongKeMuaHangKhachHangTheoNam(nam, id_tk);
        GridView2.DataBind();

    }
}
